package com.shiyanlou.upms.system.service;

import com.shiyanlou.upms.common.domain.Tree;
import com.shiyanlou.upms.system.domain.UpmsPermission;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface UpmsPermissionService {
    int deleteByPrimaryKey(Integer permissionId);

    int insert(UpmsPermission record);

    int insertSelective(UpmsPermission record);

    UpmsPermission selectByPrimaryKey(Integer permissionId);

    int updateByPrimaryKeySelective(UpmsPermission record);

    int updateByPrimaryKey(UpmsPermission record);
    //总记录数
    int count(Map<String,Object> map);
    //分页列表
    List<UpmsPermission> list(Map<String,Object> map);
    //批量删除
    int batchRemove(Integer[] userIds);
    // 通过用户 ID 查找资源
    Set<String> selectByUserId(Integer userId);

    // 通过用户ID获取目录菜单信息
    List<UpmsPermission> selectPermissionByUserId(Integer userId);

    // 获取树形菜单
    public List<Tree<UpmsPermission>> getTreeByUserId(Integer userId);

    // 通过角色获取目录菜单信息
    public List<UpmsPermission> selectPermissionByRoleId(Integer roleId);

    // 获取树形菜单
    public List<Tree<UpmsPermission>> getTree(Integer roleId);
}
